<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>个人信息</title>
	<meta name="decorator" content="nblank"/>
</head>
<body>
<div class="content container">
	<h2 class="page-title">个人中心
		<small> 基本信息</small>
	</h2>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/user/info">基本信息</a></li>
		<li><a href="${ctx}/sys/user/modifyPwd">修改密码</a></li>
	</ul>
	<section class="widget widget-tabs widget-table-overflow ">
		<div class="body tab-content">
	<form:form id="inputForm" modelAttribute="user" action="${ctx}/sys/user/info" method="post" class="form-horizontal"><%--
		<form:hidden path="email" htmlEscape="false" maxlength="255" class="input-xlarge"/>
		<sys:ckfinder input="email" type="files" uploadPath="/mytask" selectMultiple="false"/> --%>
		<sys:message content="${message}"/>
		<%--<div class="form-group">--%>
			<%--<label class="control-label col-sm-4">头像:</label>--%>
			<%--<div class="col-sm-4">--%>
				<%--<form:hidden id="nameImage" path="photo" htmlEscape="false" maxlength="255" class="input-xlarge"/>--%>
				<%--<sys:ckfinder input="nameImage" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>--%>
			<%--</div>--%>
		<%--</div>--%>
		<div class="form-group">
			<label class="control-label col-sm-4">归属公司:</label>
			<div class="col-sm-4">
				<label class="lbl">${user.company.name}</label>
			</div>
		</div>
		<div class="form-group">
			<label class="control-label col-sm-4">归属部门:</label>
			<div class="col-sm-4">
				<label class="lbl">${user.office.name}</label>
			</div>
		</div>
		<div class="form-group">
			<label class="control-label col-sm-4"><span><span style="color:red;">*</span></span> 姓名:</label>
			<div class="col-sm-4">
				<form:input path="name" htmlEscape="false" maxlength="50" class="form-control input-transparent" readonly="true"/>
			</div>
		</div>
		<div class="form-group">
			<label class="control-label col-sm-4">邮箱:</label>
			<div class="col-sm-4">
				<form:input path="email" htmlEscape="false" maxlength="50" class="form-control input-transparent"/>
			</div>
		</div>
		<div class="form-group">
			<label class="control-label col-sm-4"><span><span style="color:red;">*</span></span> 电话:</label>
			<div class="col-sm-4">
				<form:input path="phone" htmlEscape="false" maxlength="50" class="form-control input-transparent"/>
			</div>
		</div>
		<div class="form-group">
			<label class="control-label col-sm-4"><span><span style="color:red;">*</span></span> 手机:</label>
			<div class="col-sm-4">
				<form:input path="mobile" htmlEscape="false" maxlength="50" cssClass="form-control input-transparent"/>
			</div>
		</div>
		<div class="form-group">
			<label class="control-label col-sm-4">备注:</label>
			<div class="col-sm-4">
				<form:textarea path="remarks" htmlEscape="false" rows="3" maxlength="200" class="form-control input-transparent"/>
			</div>
		</div>
		<div class="form-group">
			<label class="control-label col-sm-4">用户类型:</label>
			<div class="col-sm-4">
				<label class="lbl">${fns:getDictLabel(user.userType, 'sys_user_type', '无')}</label>
			</div>
		</div>
		<div class="form-group">
			<label class="control-label col-sm-4">用户角色:</label>
			<div class="col-sm-4">
				<label class="lbl">${user.roleNames}</label>
			</div>
		</div>
		<div class="form-group">
			<label class="control-label col-sm-4">上次登录:</label>
			<div class="col-sm-4">
				<label class="lbl">IP: ${user.oldLoginIp}&nbsp;&nbsp;&nbsp;&nbsp;时间：<fmt:formatDate value="${user.oldLoginDate}" type="both" dateStyle="full"/></label>
			</div>
		</div>
		<div class="form-actions">
			<div class="text-align-center">
				<input id="btnCancel" class="btn btn-default" type="button" style="margin-left: -50px;min-width:100px;" value="返 回" onclick="history.go(-1)"/>
				<input id="btnSubmit" class="btn btn-primary" style="margin-left:50px;min-width:100px;" type="submit" value="保 存"/>&nbsp;
			</div>
		</div>
	</form:form>
			</div>
		</section>
	</div>
<script type="text/javascript">
	$(document).ready(function() {
		$("#inputForm").validate({
			submitHandler: function(form){
				loading('正在提交，请稍等...');
				form.submit();
			},
			errorContainer: "#messageBox",
			errorPlacement: function(error, element) {
				$("#messageBox").text("输入有误，请先更正。");
				if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
					error.appendTo(element.parent().parent());
				} else {
					error.insertAfter(element);
				}
			}
		});
	});
</script>
</body>
</html>